import classNames from 'classnames';
import React from 'react';
import OStyle from './index.less';
import { IFilePathBreadCrumbItemProps } from './interface';
const FilePathBreadCrumbItem: React.FC<IFilePathBreadCrumbItemProps> = (props) => {
  const {
    item: { key, label, disabled },
    onItemClick,
  } = props;
  return (
    <span
      className={classNames(OStyle.safe_edu_breadcrumb_label, {
        [`${OStyle.label_disabled}`]: disabled,
      })}
      onClick={(e) => {
        if (disabled) return;
        onItemClick?.(e, { key, label });
      }}
    >
      {label}
    </span>
  );
};

export default FilePathBreadCrumbItem;
